// 清除浮动
@mixin clearfix {
  &:before, &:after {
    content: " ";
    display: table;
  }
  &:after {
    clear: both;
  }
}

// 多行省略
@mixin multi-ellipsis($lines) {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: $lines;
  -webkit-box-orient: vertical;
}

// 单行省略
@mixin ellipsis {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

// 1px 边框
$border-poses: top, right, bottom, left;
@mixin border-retina($border-retina-color: $gray-light, $poses: $border-poses) {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 200%;
  height: 200%;
  transform: scale(.5);
  transform-origin: 0 0;
  pointer-events: none;
  box-sizing: border-box;
  @each $pos in $poses {
    border-#{$pos}: 1px solid $border-retina-color;
  }
}

// 1px线
@mixin hairline($border-retina-color: $gray-light) {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 200%;
  height: 200%;
  transform: scale(.5);
  transform-origin: 0 0;
  pointer-events: none;
  box-sizing: border-box;
  border: 0 solid $border-retina-color;
}

@mixin gradient($start-color: #54d58e, $end-color: #34b98a) {
  background-image: linear-gradient(180deg, $start-color, $end-color);
}

@mixin flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}
